feat(feedback): Add screenshot attachment button to user feedback widget - #5828
Merged
Conversation
Contributor
|
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| a416a65 | 333.78 ms | 410.37 ms | 76.59 ms |
| 2195398 | 319.02 ms | 342.38 ms | 23.36 ms |
| 62b579c | 349.26 ms | 426.26 ms | 77.00 ms |
| bbc35bb | 324.88 ms | 425.73 ms | 100.85 ms |
| e59e22a | 374.68 ms | 442.14 ms | 67.46 ms |
| 806307f | 357.85 ms | 424.64 ms | 66.79 ms |
| 62b579c | 312.88 ms | 361.57 ms | 48.70 ms |
| 8687935 | 332.52 ms | 362.23 ms | 29.71 ms |
| 1edbdfa | 364.77 ms | 450.29 ms | 85.52 ms |
| 2195398 | 322.52 ms | 361.91 ms | 39.39 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| a416a65 | 1.58 MiB | 2.12 MiB | 555.26 KiB |
| 2195398 | 0 B | 0 B | 0 B |
| 62b579c | 0 B | 0 B | 0 B |
| bbc35bb | 1.58 MiB | 2.12 MiB | 553.01 KiB |
| e59e22a | 1.58 MiB | 2.20 MiB | 635.34 KiB |
| 806307f | 1.58 MiB | 2.10 MiB | 533.42 KiB |
| 62b579c | 0 B | 0 B | 0 B |
| 8687935 | 1.58 MiB | 2.19 MiB | 619.17 KiB |
| 1edbdfa | 1.58 MiB | 2.20 MiB | 635.34 KiB |
| 2195398 | 0 B | 0 B | 0 B |
Previous results on branch: feat/feedback-screenshot-attachment
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 86e5409 | 326.20 ms | 351.31 ms | 25.11 ms |
| 676848b | 367.87 ms | 443.02 ms | 75.15 ms |
| e07d37f | 355.46 ms | 419.13 ms | 63.67 ms |
| f26f131 | 316.70 ms | 333.33 ms | 16.63 ms |
| 37c6869 | 327.68 ms | 381.06 ms | 53.38 ms |
| 71243e7 | 313.69 ms | 370.22 ms | 56.54 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 86e5409 | 0 B | 0 B | 0 B |
| 676848b | 0 B | 0 B | 0 B |
| e07d37f | 0 B | 0 B | 0 B |
| f26f131 | 0 B | 0 B | 0 B |
| 37c6869 | 0 B | 0 B | 0 B |
| 71243e7 | 0 B | 0 B | 0 B |
markushi
marked this pull request as ready for review
July 23, 2026 17:27
markushi
requested review from
0xadam-brown,
adinauer,
romtsn and
runningcode
as code owners
July 23, 2026 17:27
…entry/sentry-java into feat/feedback-screenshot-attachment
runningcode
reviewed
Jul 24, 2026
runningcode
left a comment
Contributor
There was a problem hiding this comment.
Thanks for adding this!
Use term "screenshot" everywhere Improve nullability handling
…hment paths Routes the three catch-all blocks around the screenshot picker through ExceptionUtils.rethrowIfFatal, so OOM, ThreadDeath and linkage errors propagate instead of being hidden, and logs the previously silent failure in getUriSize. Also moves the androidx.activity availability check out of SentryFeedbackScreenshotPicker, so the class is only loaded once the check passed, as its javadoc requires. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… buttons The form was not scrollable, so in landscape or at large font scales the send and cancel buttons were pushed off screen and the dialog could not be dismissed. Wraps it in a ScrollView. Also replaces the three full width buttons with the framework dialog button bar: cancel and send sit in a right aligned bar, and the screenshot button becomes a borderless full width action. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…istration ActivityResultRegistry.registerKey returns early for a key that is already registered, so re-registering would not have thrown. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…hot-attachment # Conflicts: # CHANGELOG.md # sentry-android-core/src/main/java/io/sentry/android/core/SentryUserFeedbackForm.java # sentry-android-core/src/test/java/io/sentry/android/core/SentryUserFeedbackFormTest.kt # sentry/api/sentry.api # sentry/src/main/java/io/sentry/SentryFeedbackOptions.java # sentry/src/main/java/io/sentry/SentryOptions.java # sentry/src/test/java/io/sentry/SentryFeedbackOptionsTest.kt
…ed types AGENTS.md now forbids new catch (Throwable). Replaces the three broad catches with the types the guarded code can actually throw: - launch() documents ActivityNotFoundException and the registry throws IllegalStateException for an unregistered launcher - the ContentResolver calls cross into the provider process, where Binder can only deliver the exceptions Parcel marshals, all RuntimeException Fatal throwables now propagate because they are never caught, so ExceptionUtils.rethrowIfFatal is no longer needed here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5edad4a. Configure here.
androidx.activity is a compileOnly dependency, so the version in the app's apk is outside our control and may be missing the photo picker APIs this was compiled against. Catches LinkageError locally at the two call sites that link against it, then falls back to the sanctioned ExceptionUtils.rethrowIfFatal pattern, as ExceptionUtils documents and SentrySQLiteDriver.hasConnectionPool demonstrates. Registration is now guarded too, so a version mismatch hides the screenshot button instead of breaking the whole form. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
runningcode
approved these changes
Aug 14, 2026
runningcode
left a comment
Contributor
There was a problem hiding this comment.
looks better! i think we can simplify the stuff around calling the picker!
romtsn
reviewed
Aug 24, 2026
romtsn
reviewed
Aug 24, 2026
romtsn
reviewed
Aug 24, 2026
romtsn
reviewed
Aug 24, 2026
* docs(agents): Remove duplicated build commands and rules AGENTS.md is force-read at the start of every session, so anything stated there costs context on every task. Several rules had accumulated multiple copies of themselves within that one file. `spotlessApply`/`apiDump` was stated five times in AGENTS.md; it is now stated once as a command and once as a workflow step, with the underlying facts (Spotless enforces formatting, `.api` files are generated) kept where they belong. The Testing command block is dropped in favour of the `test` skill, which already resolves the per-module task and the unit-vs-system split and does not drift. The Repository Skills bullet list restated skill descriptions that the harness already injects, so it is now a pointer. In the rules, `new_module.mdc`'s "Important Notes" was a verbatim restatement of the AGENTS.md contributing guidelines, and `api.mdc` repeated the opt-in-by-default rule in passing; both now defer to their canonical homes. No guidance is lost — every removed line is still stated somewhere that is loaded when it applies. * docs(agents): Refresh new_module rule and cover full system-test runs Validating the previous commit with agents surfaced two gaps. `new_module.mdc` had drifted from the repo. Its README badge snippet still used the retired maven-badges.herokuapp.com format, while every current row in README.md uses shields.io with a central.sonatype.com link. It also never mentioned four steps that every existing integration module performs: the `SENTRY_*_SDK_NAME` constant in `Config.kt` consumed by buildConfig and the jar manifest, the `libs.versions.toml` entry paired with a `compileOnly` dependency, self-registration via `SentryIntegrationPackageStorage.addPackage` and `addIntegrationToSdkVersion`, and the integrations dropdown in the issue template. It now also points at `sentry-kafka` and `sentry-android-timber` as build-script templates, and records that `sentry-bom` and the root build file need no change because they iterate over subprojects. The `test` skill only ever ran a single module, so folding the AGENTS.md testing block into it dropped the only reference to running the whole system test suite. Step 3b now covers `make systemTest` and `make systemTestInteractive`.
* perf(android): Use build-time manifest metadata Allow the Android Gradle plugin to provide authoritative manifest metadata so SDK initialization can skip PackageManager and Bundle unparceling. Read the injected map directly to avoid conversion overhead. Refs JAVA-531 Co-Authored-By: Codex <noreply@openai.com> * changelog * ref(android): Store metadata in manifest reader Use ManifestMetadataReader directly as the Gradle plugin injection target and remove the dedicated holder class. Co-Authored-By: OpenAI Codex <noreply@openai.com> * docs: Generalize performance changelog entry Remove the device-specific benchmark percentage from the release note. Co-Authored-By: Codex <noreply@openai.com> * docs: Update replacement PR changelog link Point the performance entry at the replacement pull request. Co-Authored-By: Codex <noreply@openai.com> --------- Co-authored-by: Codex <noreply@openai.com>
buenaflor
pushed a commit
that referenced
this pull request
Aug 25, 2026
…get (#5828) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

📜 Description
Adds an "Add a screenshot" button to the Android user feedback form that opens the
androidx photo picker (
ActivityResultContracts.PickVisualMedia, images only) and sendsthe picked image as an attachment in the same envelope as the feedback.
Screen_recording_20260813_202418.mp4
SentryFeedbackOptions:enableAttachScreenshot(defaulttrue, matching the JS SDK),addScreenshotButtonLabel,removeScreenshotButtonLabel,screenshotTooLargeMessageText, plus theio.sentry.feedback.enable-attach-screenshotmanifest flagandroidx.activity:activity:1.8.2is added as compileOnly — no new transitivedependency; the button is hidden (with a warning log) when androidx.activity is missing
or the host Activity is not a
ComponentActivitymaxAttachmentSizeat pick timeFixed along the way
The form was not scrollable, so in landscape or at large font scales the send and cancel
buttons were pushed off screen and the dialog could not be dismissed. It is now wrapped in
a
ScrollView, and the three full width buttons were replaced with the framework dialogbutton bar (cancel and send in a right aligned bar, screenshot as a borderless full width
action). No changelog entry, as it is bundled with this feature.
💡 Motivation and Context
💚 How did you test it?
Unit tests + Manual testing.
📝 Checklist
sendDefaultPIIis enabled.